# 导入redis模块
from redis import StrictRedis
class Config:
    DEBUG = None
    SECRET_KEY = 'ozdu7bOLM5vSDaW7g3G6ydLM4WdZyZpi1AMwIFQ959lWBQNIbVDVy+BNN0/tuSQ5TQ=='
    SESSION_TYPE = 'redis'  # 设置redis数据存储session
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_USE_SIGNER = True  # 设置用户签名为True
    PERMANENT_SESSION_LIFETIME = 60 * 60 * 24

    # 配值数据库信息
    SQLALCHEMY_DATABASE_URI = "mysql://root:19970125@127.0.0.1:3306/news_info"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

# 定义开发环境配置
class DevelopmentConfig(Config):
    DEBUG = True

# 定义生产环境配置
class ProductionConfig(Config):
    DEBUG = False

# 定义配置映射关系
config_dict = {
    "development":DevelopmentConfig,
    "production": ProductionConfig
}


